home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Games
/
SpriteFight 2002 v2.0a1
/
SpriteForeground.c
< prev
next >
Wrap
Text File
|
1996-04-19
|
1KB
|
60 lines
/*******************************************************
*** SpriteForeground.c
*** By: Stefan C. Sinclair
*** Copyright © 1996 All Rights Reserved Worldwide.
*** Brief description here
*******************************************************/
#include "SpriteForeground.h"
extern CWindowPtr gWindowP;
extern short gFrameAdvanceTime;
extern RgnHandle gWorkRgn;
// CreateForegroundSprite
OSErr CreateForegroundSprite(void *spriteStorageP, short foregroundSpriteID)
{
SpritePtr tempSpriteP;
short firstPICTID, firstMaskID, numFrames;
OSErr err;
switch(foregroundSpriteID)
{
case kBagLadySpriteID:
firstPICTID = kBagLadyPICTID;
firstMaskID = kBagLadyMaskPICTID;
numFrames = 4;
break;
case kWheelChairSpriteID:
firstPICTID = kWheelChairPICTID;
firstMaskID = kWheelChairMaskPICTID;
numFrames = 4;
break;
default:
firstPICTID = kBagLadyPICTID;
firstMaskID = kBagLadyMaskPICTID;
numFrames = 4;
break;
}
err = SWCreateSpriteFromPictResource(&tempSpriteP,spriteStorageP,
firstPICTID, firstMaskID,numFrames,kRegionMask);
return err;
}
void SetupForegroundSprite(SpritePtr spriteP, short foregroundSpriteID)
{
switch(foregroundSpriteID)
{
case kBagLadySpriteID:
SetupBagLadySprite(spriteP);
break;
case kWheelChairSpriteID:
SetupWheelChairSprite(spriteP);
break;
default:
SetupBagLadySprite(spriteP);
break;
}
}